package com.ncr.travel.appmgr.client.ui.table;

import com.google.gwt.user.client.ui.Widget;

/**
 * An interface that describes the required functionality of all data stored in a TableModel
 * 
 * @author ma250087
 */
public interface TableData {
	/**
	 * Return the Widget stored in the specified column
	 * @param column The column id to return data for
	 * @return The Widget stored in the specified column or null if the specified column does not exist
	 */
	public Widget get(String column);

	/**
	 * Set the Widget for the specified column
	 * @param column The column to be set
	 * @param w The Widget to be stored for the given column
	 */
	public void set(String column, Widget w);

	/**
	 * Compare column data for this column against that of the specified TableData obj
	 * @param obj The TableData object this object is being compared against
	 * @param column The column id of each object that should be compared
	 * @return True if this object should come before obj in an _ascending_ sort of the two objects or false otherwise 
	 */
	public boolean compare(TableData obj, String column);
}